package com.neegix.log.loginLog.infrastructure.repository.impl;

import com.neegix.log.loginLog.domain.entity.LoginLogEntity;
import com.neegix.log.loginLog.domain.repository.LoginLogRepository;
import com.neegix.log.loginLog.infrastructure.repository.convert.LoginLogConverter;
import com.neegix.log.loginLog.infrastructure.repository.dataobject.LoginLogDO;
import com.neegix.log.loginLog.infrastructure.repository.mapper.LoginLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * This file is auto-generated by nebula-framework-generator.
 * The auto-generation plugin was developed using IntelliJ IDEA Community Edition.
 * Thanks to JetBrains for their outstanding contributions to the developer community.
 * <p>
 * The code generated by this tool is owned by the user of the tool.
 * The tool itself is copyrighted by <a href="https://www.neegix.com">https://www.neegix.com</a>.
 *
 * @author <a href="https://www.neegix.com">https://www.neegix.com</a>
 * @version 1.0.0
 * @since 2024-12-19 15:39:21
 */

@Repository
public class LoginLogRepositoryImpl implements LoginLogRepository {

    @Autowired
    private LoginLogMapper loginLogMapper;

    @Override
    public void removeByIds(List<Long> longs) {
       loginLogMapper.deleteByPrimaryKeys(longs);
    }

    @Override
    public Optional<LoginLogEntity> findById(Long aLong) {
        LoginLogDO loginLogDO = loginLogMapper.selectByPrimaryKey(aLong);
        return Optional.ofNullable(LoginLogConverter.INSTANCE.covertEntity(loginLogDO));
    }
}
